Skip to content

feat: update codex adapter and migrate to base acp prxy for agent#1480

Merged
k11kirky merged 1 commit intomainfrom
04-03-feat_update_codex_adapter_and_migrate_to_base_acp_prxy_for_agent
Apr 6, 2026
Merged

feat: update codex adapter and migrate to base acp prxy for agent#1480
k11kirky merged 1 commit intomainfrom
04-03-feat_update_codex_adapter_and_migrate_to_base_acp_prxy_for_agent

Conversation

@k11kirky
Copy link
Copy Markdown
Contributor

@k11kirky k11kirky commented Apr 3, 2026

TLDR: upgraded codex acp bin and started moving over to similar proxy agent as claude agent sdk

Problem

The Codex adapter was using a raw stream transformation approach that made it difficult to implement PostHog-specific features like session tracking, usage accumulation, and proper session resume/fork capabilities. This approach also lacked proper interception points for ACP protocol messages.

Changes

Upgraded codex-acp binary from v0.9.5 to v0.11.1 to get the latest features and bug fixes.

Replaced raw stream transformation with proper ACP Agent implementation:

  • Created CodexAcpAgent class that implements the ACP Agent interface
  • Added CodexClient to handle delegation between codex-acp subprocess and upstream PostHog Code client
  • Implemented proper session state tracking with CodexSessionState and CodexSettingsManager
  • Added support for session resume/fork operations (not natively supported by codex-acp)

Enhanced PostHog integration:

  • Proper _posthog/sdk_session notification emission for session tracking
  • Usage accumulation and _posthog/usage_update notifications
  • Session metadata handling for task runs and persistence

Improved architecture:

  • Moved from direct stream manipulation to proper ACP protocol handling
  • Added consistent settings management interface shared with Claude adapter
  • Better error handling and cleanup for subprocess management
  • Proper terminal handle delegation for codex-acp terminal operations

@k11kirky k11kirky force-pushed the 04-03-feat_update_codex_adapter_and_migrate_to_base_acp_prxy_for_agent branch from bb3031e to b772ead Compare April 6, 2026 21:16
@k11kirky k11kirky force-pushed the 04-03-feat_codex_5.4_default_and_pass_to_model branch from c5a32b2 to 2ba30f5 Compare April 6, 2026 21:16
Copy link
Copy Markdown
Contributor Author

k11kirky commented Apr 6, 2026

Merge activity

  • Apr 6, 9:47 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Apr 6, 9:49 PM UTC: Graphite rebased this pull request as part of a merge.
  • Apr 6, 9:56 PM UTC: @k11kirky merged this pull request with Graphite.

@k11kirky k11kirky changed the base branch from 04-03-feat_codex_5.4_default_and_pass_to_model to graphite-base/1480 April 6, 2026 21:47
@k11kirky k11kirky changed the base branch from graphite-base/1480 to main April 6, 2026 21:47
@k11kirky k11kirky force-pushed the 04-03-feat_update_codex_adapter_and_migrate_to_base_acp_prxy_for_agent branch from b772ead to 3c5b948 Compare April 6, 2026 21:48
@k11kirky k11kirky merged commit de21189 into main Apr 6, 2026
16 checks passed
@k11kirky k11kirky deleted the 04-03-feat_update_codex_adapter_and_migrate_to_base_acp_prxy_for_agent branch April 6, 2026 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants